<template>
  <div class="export-products">
    <div class="section-header">
      <h3>
        <i class="fas fa-globe"></i>
        <span>出口热卖</span>
      </h3>
      <NuxtLink to="/export" class="more-link">
        <span>查看全部</span>
        <i class="fas fa-angle-double-right"></i>
      </NuxtLink>
    </div>
    
    <div class="products-grid">
      <NuxtLink 
        v-for="product in products" 
        :key="product.id"
        :to="`/products/${product.id}`"
        class="product-card"
      >
        <div class="product-image">
          <img :src="product.image" :alt="product.name" />
          <div class="export-badge">
            <i class="fas fa-ship"></i>
            {{ product.exportCountry }}
          </div>
          <div class="quality-badge" v-if="product.isPremium">
            <i class="fas fa-star"></i>
            出口精选
          </div>
        </div>
        <div class="product-info">
          <h4>{{ product.name }}</h4>
          <p class="description">{{ product.description }}</p>
          <div class="price-row">
            <span class="price">¥ {{ product.price }}</span>
            <span class="unit">/{{ product.unit }}</span>
            <span class="rating">
              <i class="fas fa-star"></i>
              {{ product.rating }}
            </span>
          </div>
        </div>
      </NuxtLink>
    </div>
  </div>
</template>

<script setup>
const products = [
  {
    id: 7,
    name: '优质干香菇出口装',
    description: '符合欧盟标准，无农残检测，出口品质',
    price: '168.00',
    unit: '500g',
    rating: 4.9,
    exportCountry: '欧盟',
    exportVolume: '5000kg/月',
    isPremium: true,
    image: '/images/export-1.jpg',
  },
  {
    id: 8,
    name: '精选黑木耳出口级',
    description: '日本市场热销，肉厚无杂质，口感爽滑',
    price: '188.00',
    unit: '500g',
    rating: 4.8,
    exportCountry: '日本',
    exportVolume: '3000kg/月',
    isPremium: true,
    image: '/images/export-2.jpg',
  },
  {
    id: 9,
    name: '特级银耳出口装',
    description: '韩国认证品质，朵形完整，色泽洁白',
    price: '228.00',
    unit: '250g',
    rating: 5.0,
    exportCountry: '韩国',
    exportVolume: '2000kg/月',
    isPremium: true,
    image: '/images/export-3.jpg',
  },
  {
    id: 10,
    name: '有机菌菇组合装',
    description: '美国有机认证，多品种组合，营养丰富',
    price: '358.00',
    unit: '礼盒',
    rating: 4.9,
    exportCountry: '美国',
    exportVolume: '1500kg/月',
    isPremium: true,
    image: '/images/export-4.jpg',
  },
  {
    id: 11,
    name: '精品竹荪出口装',
    description: '新加坡市场热销，菌裙完整，香味浓郁',
    price: '288.00',
    unit: '250g',
    rating: 4.8,
    exportCountry: '新加坡',
    exportVolume: '800kg/月',
    isPremium: true,
    image: '/images/export-5.jpg',
  },
  {
    id: 12,
    name: '野生松茸出口级',
    description: '澳洲高端市场，野生采集，品质保证',
    price: '688.00',
    unit: '250g',
    rating: 5.0,
    exportCountry: '澳洲',
    exportVolume: '300kg/月',
    isPremium: true,
    image: '/images/export-6.jpg',
  },
]
</script>

<style lang="scss" scoped>
.export-products {
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    
    h3 {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      color: #333;
      
      i {
        color: #1890ff;
        font-size: 22px;
      }
    }
    
    .more-link {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #666;
      font-size: 14px;
      text-decoration: none;
      transition: all 0.3s;
      
      &:hover {
        color: #1890ff;
      }
    }
  }
  
  .products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: $spacing-md;

    @include tablet {
      grid-template-columns: repeat(3, 1fr);
      gap: $spacing-sm;
    }

    @include mobile {
      grid-template-columns: repeat(2, 1fr);
      gap: $spacing-sm;
    }
    
    .product-card {
      background: #fff;
      border-radius: 10px;
      overflow: hidden;
      text-decoration: none;
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      border: 1px solid transparent;
      position: relative;
      
      &:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
        border-color: #1890ff;
        
        .product-image img {
          transform: scale(1.1);
        }
      }
      
      .product-image {
        position: relative;
        width: 100%;
        height: 140px;
        overflow: hidden;
        
        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: all 0.5s;
        }
        
        .export-badge {
          position: absolute;
          bottom: 8px;
          left: 8px;
          display: flex;
          align-items: center;
          gap: 4px;
          padding: 3px 8px;
          background: rgba(24, 144, 255, 0.9);
          color: #fff;
          border-radius: 12px;
          font-size: 11px;
          
          i {
            font-size: 10px;
          }
        }
        
        .quality-badge {
          position: absolute;
          top: 8px;
          right: 8px;
          display: flex;
          align-items: center;
          gap: 4px;
          padding: 3px 8px;
          background: rgba(255, 193, 7, 0.9);
          color: #fff;
          border-radius: 12px;
          font-size: 11px;
          
          i {
            font-size: 10px;
          }
        }
      }
      
      .product-info {
        padding: 12px;
        
        h4 {
          margin: 0 0 6px;
          font-size: 14px;
          font-weight: 600;
          color: #333;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        
        .description {
          margin: 0 0 10px;
          font-size: 12px;
          color: #999;
          height: 32px;
          overflow: hidden;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          line-height: 1.4;
        }
        
        .price-row {
          display: flex;
          align-items: baseline;
          margin-bottom: 6px;
          
          .price {
            color: #1890ff;
            font-size: 16px;
            font-weight: 700;
          }
          
          .unit {
            color: #999;
            font-size: 11px;
            margin-left: 2px;
          }
          
          .rating {
            margin-left: auto;
            font-size: 12px;
            color: #faad14;
            display: flex;
            align-items: center;
            gap: 2px;
            
            i {
              font-size: 12px;
            }
          }
        }
        
      }
    }
  }
}
</style>
